#!/usr/lib/env python
#coding: utf-8
##########################################
import pg
import logging as log
from crawldb import DB_crawl

def tras(db = None):
	if db == None:
		db = DB_crawl()
		dbOut=1
	else:
		dbOut=0		
	
	cars = db.query(
		"""select * from cars_fti where index @@ to_tsquery('汽&车') limit 10"""
	).dictresult();
	print 'count::::',len(cars)
	for r in cars:
		print '-'*13
		k = r.keys()	
		v = r.values()	
		for i in k:
			print i,' | '
		for i in v :
			print i,' | '
		print '-'*13

if __name__=="__main__":
	tras()

